package com.xiaoqi.store.entity;

import lombok.*;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * @Author Rookie Coder
 * @Description 收货地址
 * @Date
 **/

public class AddressEntity extends BaseEntity implements Serializable {

    private  Integer aid;//'收货地址id',
    private  Integer uid ;//INT COMMENT '归属的用户id',
    private  String name ;//VARCHAR(20) COMMENT '收货人姓名',
    private  String provinceName ;//VARCHAR(15) COMMENT '省-名称',
    private  String provinceCode;// CHAR(6) COMMENT '省-行政代号',
    private  String cityName;// VARCHAR(15) COMMENT '市-名称',
    private  String cityCode;// CHAR(6) COMMENT '市-行政代号',
    private  String areaName ;// '区-名称',
    private  String areaCode ;//'区-行政代号',
    private  String zip; // '邮政编码',
    private  String address ;// '详细地址',
    private  String phone ;// '手机',
    private  String tel ;// '固话',
    private  String tag;// '标签',
    private  Integer isDefault ;// '是否默认：0-不默认，1-默认',

    public AddressEntity(String createdUser, Date createdTime, String modifiedUser, Date modifiedTime, Integer aid, Integer uid, String name, String provinceName, String provinceCode, String cityName, String cityCode, String areaName, String areaCode, String zip, String address, String phone, String tel, String tag, Integer isDefault) {
        super(createdUser, createdTime, modifiedUser, modifiedTime);
        this.aid = aid;
        this.uid = uid;
        this.name = name;
        this.provinceName = provinceName;
        this.provinceCode = provinceCode;
        this.cityName = cityName;
        this.cityCode = cityCode;
        this.areaName = areaName;
        this.areaCode = areaCode;
        this.zip = zip;
        this.address = address;
        this.phone = phone;
        this.tel = tel;
        this.tag = tag;
        this.isDefault = isDefault;
    }

    public AddressEntity(Integer aid, Integer uid, String name, String provinceName, String provinceCode, String cityName, String cityCode, String areaName, String areaCode, String zip, String address, String phone, String tel, String tag, Integer isDefault) {
        this.aid = aid;
        this.uid = uid;
        this.name = name;
        this.provinceName = provinceName;
        this.provinceCode = provinceCode;
        this.cityName = cityName;
        this.cityCode = cityCode;
        this.areaName = areaName;
        this.areaCode = areaCode;
        this.zip = zip;
        this.address = address;
        this.phone = phone;
        this.tel = tel;
        this.tag = tag;
        this.isDefault = isDefault;
    }

    public AddressEntity() {
    }

    public Integer getAid() {
        return aid;
    }

    public void setAid(Integer aid) {
        this.aid = aid;
    }

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getProvinceName() {
        return provinceName;
    }

    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }

    public String getProvinceCode() {
        return provinceCode;
    }

    public void setProvinceCode(String provinceCode) {
        this.provinceCode = provinceCode;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public String getCityCode() {
        return cityCode;
    }

    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }

    public String getAreaName() {
        return areaName;
    }

    public void setAreaName(String areaName) {
        this.areaName = areaName;
    }

    public String getAreaCode() {
        return areaCode;
    }

    public void setAreaCode(String areaCode) {
        this.areaCode = areaCode;
    }

    public String getZip() {
        return zip;
    }

    public void setZip(String zip) {
        this.zip = zip;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public Integer getIsDefault() {
        return isDefault;
    }

    public void setIsDefault(Integer isDefault) {
        this.isDefault = isDefault;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof AddressEntity)) return false;
        if (!super.equals(o)) return false;
        AddressEntity that = (AddressEntity) o;
        return Objects.equals(getAid(), that.getAid()) &&
                Objects.equals(getUid(), that.getUid()) &&
                Objects.equals(getName(), that.getName()) &&
                Objects.equals(getProvinceName(), that.getProvinceName()) &&
                Objects.equals(getProvinceCode(), that.getProvinceCode()) &&
                Objects.equals(getCityName(), that.getCityName()) &&
                Objects.equals(getCityCode(), that.getCityCode()) &&
                Objects.equals(getAreaName(), that.getAreaName()) &&
                Objects.equals(getAreaCode(), that.getAreaCode()) &&
                Objects.equals(getZip(), that.getZip()) &&
                Objects.equals(getAddress(), that.getAddress()) &&
                Objects.equals(getPhone(), that.getPhone()) &&
                Objects.equals(getTel(), that.getTel()) &&
                Objects.equals(getTag(), that.getTag()) &&
                Objects.equals(getIsDefault(), that.getIsDefault());
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), getAid(), getUid(), getName(), getProvinceName(), getProvinceCode(), getCityName(), getCityCode(), getAreaName(), getAreaCode(), getZip(), getAddress(), getPhone(), getTel(), getTag(), getIsDefault());
    }

    @Override
    public String toString() {
        return "AddressEntity{" +
                "aid=" + aid +
                ", uid=" + uid +
                ", name='" + name + '\'' +
                ", provinceName='" + provinceName + '\'' +
                ", provinceCode='" + provinceCode + '\'' +
                ", cityName='" + cityName + '\'' +
                ", cityCode='" + cityCode + '\'' +
                ", areaName='" + areaName + '\'' +
                ", areaCode='" + areaCode + '\'' +
                ", zip='" + zip + '\'' +
                ", address='" + address + '\'' +
                ", phone='" + phone + '\'' +
                ", tel='" + tel + '\'' +
                ", tag='" + tag + '\'' +
                ", isDefault=" + isDefault +
                '}';
    }
}
